/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.oper;

import java.awt.*;

/**
 * <p>Project: app2022 - Bit1
 * <p>Powered by webrx On 2022-01-06 15:55:02
 *
* @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Bit1 {
    public static void main(String[] args) {
        int i = 7;
        System.out.println(i);
        System.out.println(Integer.toBinaryString(i));//11111111
        System.out.println(Integer.toOctalString(i));//377
        System.out.println(Integer.toHexString(i));//ff


        //二进制输出10进制
        System.out.println(0b11111111);//255
        //八进制输出10进制
        System.out.println(010);//8

        //十六进制
        System.out.println(0xff);//255
        System.out.println(0b101);
        //1 10 11 100 101

        System.out.println(Integer.valueOf("10", 2));
        System.out.println(Integer.valueOf("11111111", 2));
        System.out.println(Integer.valueOf("377", 8));
        System.out.println(Integer.valueOf("ff", 16));

        System.out.println(0xa);
        System.out.printf("#%02x%02x%02x%n", 255, 0, 255); //#ff00ff
        var c = new Color(0xff, 0x00, 0xff);

    }
}
